<template>
  <div class="noPass-wrapper">
    <Dialog ref="dialog" :title="title" class="dialog" @closeDialog="confirm">
      <el-form ref="form" :model="form" label-width="100px">
        <el-form-item label="不通过理由:">
          <el-input v-model="form.remark" type="textarea" :disabled="disabled" />
        </el-form-item>
      </el-form>
    </Dialog>
  </div>
</template>
<script>
import Dialog from '@/common/dialog'
export default {
  components: {
    Dialog
  },
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    id: {
      type: [String, Number],
      default: ''
    },
    remark: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      title: '填写不通过理由',
      form: {
        remark: ''
      }
    }
  },
  watch: {
    remark(newVal) {
      this.form.remark = this.remark
    }
  },
  methods: {
    show() {
      this.$refs.dialog.show()
    },
    confirm() {
      this.$emit('noPassRemark', this.form.remark)
    }
  }
}
</script>
<style lang="scss" scoped>
.el-textarea /deep/ .el-textarea__inner {
  width: 278px;
  height: 137px;
  line-height: 20px;
  border: 1px solid rgba(235, 238, 245, 1);
}
.dialog /deep/ .el-dialog {
  min-width: 500px;
}
</style>
